package com.imb.provider.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.imb.common.core.annotation.ApiLog;
import com.imb.common.core.enums.OperateEnum;
import com.imb.common.mybatis.entity.ImbList;
import com.imb.common.mybatis.entity.ImbLog;
import com.imb.common.web.result.JsonResult;
import com.imb.provider.service.ImbListService;
import com.imb.provider.service.LogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xzhi
 * @desc
 * @date 2024-09-29
 */
@RestController
@RequestMapping("/api/list")
@Api(tags = "列表模块")
@Slf4j(topic = "api-log")
@RequiredArgsConstructor
public class ListController {


    private final ImbListService imbListService;

    @PostMapping()
    @ApiOperation(value = "主体列表")
    @ApiLog(method = "主体列表",type = OperateEnum.QUEY)
    public JsonResult<IPage<ImbList>> list() {
        return JsonResult.success(imbListService.findPage());
    }


    @PostMapping()
    @ApiOperation(value = "发布")
    @ApiLog(method = "发布",type = OperateEnum.OTHER)
    public JsonResult<Void> release() {
        return JsonResult.success();
    }

}
